enyo.kind({
    name: "MyApps.GolfPlus",
    kind: enyo.VFlexBox,
    events: {
        onBack: "",
    },
    
    components: [{
        name: "pane",
        kind: "Pane",
        flex: 1,
        transitionKind: "enyo.transitions.LeftRightFlyin",
        components: [{
            name: "menu",
            kind: "VFlexBox",
            className: "bg-gp",
            components: [{
                kind: "PageHeader",
                className: "enyo-header-dark",
                components: [{
                    kind: "IconButton",
                    onclick: "doBack",
                    icon: "images/menu-icon-back.png",
                    className: "enyo-button-dark"
                }, {
                    kind: "VFlexBox",
                    flex: 1,
                    align: "center",
                    components: [{
                        content: "Golf Plus"
                    }, ]
                }, ]
            }, {
                kind: "Button",
                className: "enyo-button-affirmative",
                caption: "Nos magasins",
                onclick: "showStores"
            }, {
                kind: "Button",
                className: "enyo-button-affirmative",
                caption: "Les services + Golf Plus",
                onclick: "showAdvantages"
            }, {
                kind: "Button",
                className: "enyo-button-affirmative",
                caption: "Journées démo",
                onclick: "showDemoDays"
            }, {
                kind: "Button",
                className: "enyo-button-affirmative",
                caption: "Newsletter",
                onclick: "showNewsletter"
            }, {
                kind: "Button",
                className: "enyo-button-affirmative",
                caption: "Golf Plus sur Facebook",
                onclick: "showFacebookWeb"
            }, {
                kind: "Button",
                className: "enyo-button-affirmative",
                caption: "Autre",
                onclick: "showAbout"
            }, ]
        }, {
            name: "stores",
            kind: "MyApps.Stores",
            onBack: "goBack",
            lazy: true
        }, {
            name: "advantages",
            kind: "MyApps.Advantages",
            onBack: "goBack",
            lazy: true
        }, {
            name: "demodays",
            kind: "MyApps.DemoDays",
            onBack: "goBack",
            lazy: true
        }, {
            name: "newsletter",
            kind: "MyApps.Newsletter",
            onBack: "goBack",
            lazy: true
        }, {
            name: "facebookweb",
            kind: "MyApps.Web",
            onBack: "goBack",
            lazy: true
        }, {
            name: "about",
            kind: "MyApps.About",
            onBack: "goBack",
            lazy: true
        }, ]
    }, ],
    
    showStores: function(){
        this.$.pane.selectViewByName("stores");
    },
    showAdvantages: function(){
        this.$.pane.selectViewByName("advantages");
    },
    showDemoDays: function(){
        this.$.pane.selectViewByName("demodays");
    },
    showNewsletter: function(){
        this.$.pane.selectViewByName("newsletter");
    },
    showFacebookWeb: function(){
        this.$.pane.selectViewByName("facebookweb");
        this.$.facebookweb.setUrl("http://www.facebook.com/pages/GOLF-PLUS-wwwgolfplusfr/202051404335");
        this.$.facebookweb.setTitle("Golf Plus sur Facebook");
    },
    showAbout: function(){
        this.$.pane.selectViewByName("about");
    },
    
    goBack: function(inSender, inEvent){
        this.$.pane.back(inEvent);
    }
});

